package org.quartz.impl.rmi;

import org.quartz.*;
import org.quartz.impl.jdbcjobstore.*;
import org.quartz.impl.rmi.entity.AbstractMessage;
import org.quartz.impl.rmi.entity.ConfigMessage;
import org.quartz.spi.ClassLoadHelper;
import org.slf4j.Logger;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.sql.SQLException;
import java.util.List;

/**
 * Created by guowei on 2018/1/13.
 */
public interface AbstractServerDriverDelegate extends Remote{

     void initialize(Logger logger, String tablePrefix)
            throws NoSuchDelegateException, RemoteException;

    /**
     * <p>
     * Update all triggers having one of the two given states, to the given new
     * state.
     * </p>
     * @param am AbstractMessage
     * @return number of rows updated
     */
    int updateTriggerStatesFromOtherStates(AbstractMessage am, ConfigMessage cm)
            throws SQLException, RemoteException;

    /**
     * <p>
     * Get the names of all of the triggers that have misfired - according to
     * the given timestamp.
     * </p>
     * @return an array of <code>{@link
     * org.quartz.utils.Key}</code> objects
     */
    List<TriggerKey> selectMisfiredTriggers(AbstractMessage am, ConfigMessage cm) throws SQLException, RemoteException;
}
